package com.chris.design.pattern.samples.wrapper;

/**
 * 装饰者模式Decorator，或者包装模式Wrapper
 *
 * @author shangpan
 * @date 10/09/2018
 */
public class WrapperAppMain {

    public static void main(String[] args) {
        Component component = new ConcreteComponent();
        // 第一种写法
        Component bird = new Bird(component);
        Component fish = new Fish(bird);
        bird.someOperation();

        System.out.println("==============================");
        // 第二种写法
//        Component fish = new Fish(new Bird(component));
        fish.someOperation();
    }
}